<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件-父子组件的嵌套、父向子传参</title>
</head>
<body>
    <div id="app">
        <father></father>
    </div>

    <!-- vue2 -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
    <script type="x-template" id="father">
    <!--html模板的另一种写法-->
        <div>
            父
            <children :hello="hello_fahter"></children>
        </div>
    </script>

    <script type="x-template" id="children">
        <div>
            子：{{hello}}
        </div>
    </script>

    <script>
        var children= {
            props:["hello"],
            name:"children",
            data(){
                return{
                    hello:"hello QM"
                }
            },
            template:"#children"
        };
        var father = {
            name:"father",
            template:"#father",
            data(){
                return{
                    hello_fahter:"father-hello"
                }
            },
            components:{
                children:children
            }
        };
        var app = new Vue({
            el:"#app",
            components: {
                father
            }
        });

    </script>
</body>

<!-- vue3 -->
<!-- <script src="https://unpkg.com/vue@next"></script> -->
<!--<script src="https://cdn.jsdelivr.net/npm/vue@3.2.23/dist/"></script>-->
</html>